package Q3;

import org.w3c.dom.ls.LSOutput;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static boolean retFlag;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        while (n > 0) {
            n--;
            int[] arr = new int[6];
            for (int i = 0; i < 6; i++) {
                arr[i] = scanner.nextInt();
            }

            Arrays.sort(arr);

            boolean[] flag = new boolean[6];

            dfs(arr, flag, 0, 0);
            if (retFlag) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }

            retFlag = false;
        }
    }

    public static void dfs(int[] arr, boolean[] flag, int count, int index) {
        if (count == 3) {
            //判断 flag 为 true 的边能否构成三角形
            int[] arr1 = new int[3];
            int count1 = 0;
            for (int i  = 0; i < 6; i++) {
                if (flag[i]) {
                    arr1[count1++] = arr[i];
                }
            }

            //判断 flag 为 false 的边能否构成三角形
            int[] arr2 = new int[3];
            int count2 = 0;
            for (int i  = 0; i < 6; i++) {
                if (!flag[i]) {
                    arr2[count2++] = arr[i];
                }
            }

            if (arr1[0] + arr1[1] > arr1[2] && arr2[0] + arr2[1] > arr2[2]) {
                retFlag = true;
            }

            return;
        }

        for (int i = index; i < 6; i++) {
            if (!flag[i]) {
                flag[i] = true;
                dfs(arr, flag, count + 1, i + 1);
                //回溯
                flag[i] = false;
            }

        }
    }
}
